package com.flmz.system.manager;

import com.flmz.common.core.constants.CacheConstants;
import com.flmz.common.redis.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class QuestionCacheManager {

	@Autowired
	private RedisService redisService;

	// 需要同步更新题目列表缓存（维护上一题下一题方法）
	public void addCache(Long questionId) {
		redisService.leftPushForList(CacheConstants.QUESTION_LIST, questionId);
	}

	public void deleteCache(Long questionId) {
		redisService.removeForList(CacheConstants.QUESTION_LIST, questionId);
	}
}